package com.smh.a06comprehensiveExercises;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Test {
    public static void main(String[] args) {

        List<Integer> list = new ArrayList<>();
        int sum =0;
        Scanner scanner = new Scanner(System.in);
        while (sum<200){
            System.out.println("输入1-100之间的数");
            int i = Integer.parseInt(scanner.nextLine());
            if (i<1||i>100){
                System.out.println("不合法");
                continue;
            }
            //自动装箱
            list.add(i);
            sum+=i;
        }
        System.out.println(sum);

    }
}
